#ifndef GSQUELCHLIST_H
#define GSQUELCHLIST_H

#include<QList>
#include<QString>
#include<QFile>
#include<QTextStream>
#include<QStringList>


/*!	\brief Stores the list of usernames the current user does not want to talk to.
*/
class GSquelchList : public QObject {
	Q_OBJECT
public:
	GSquelchList();
	
	/*!	\brief Saves the squelch list.
	 *	
	 *	When the save function is called the changed bit is cleared.
	 *	
	 *	@param fn The name of the file to save the squelch list to.
	*/
	void save(QString fn);
	
	/*!	\brief Loads the squelch list.
	 *	
	 *	@param fn The name of the file to load the squelch list from.
	*/
	void load(QString fn);
	
	/*!	\brief Add a username to the squelch list.
	 *	
	 *	@param name The name of the user to add to the squelch list.
	*/
	void add(QString name);
	
	/*!	\brief Remove a username from the squelch list.
	 *	
	 *	@param name The name of the user to remove from the squelch list.
	*/
	void remove(QString name);
	
	/*!	\brief Check to see if a user is not on the squelch list.
	 *	
	 *	@param name The user to check and see if he is not on the list.
	*/
	bool notSquelched(QString name);
	
	/*!	\brief Get the list of users in one string.
	 *	
	 *	@return Returns the list of users as a comma separated variable list.
	*/
	QString listCSV();
	
	void clear();
	
	/*!	\brief Checks to see if the list changed since it was last saved.
	 *	
	 *	@return The changed bit.
	*/
	bool changed();
	
	/*!	Get the number of users in the squelch list.
	 *	
	 *	@return The number of users on the squelch list.
	*/
	int size();
	
private:
	QList<QString> l;
	bool c;
	
};


#endif // GSQUELCHLIST_H
